-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add (i) tooltip button for More Info functionality on mobile devices & tooltip z-index fix #19144
Conversation
829f453
to
6b63919
Compare
…evices, lower z-index for tooltips to avoid overdrawing sidebar/dialogs
6b63919
to
e39194b
Compare
I'm not sure about the icon in the footer of the tooltip, I do think the checking for mouse or touch event is good, mind if I take that out to put in the 2024.2 release? |
That icon is a "button" on mobile, however it is not visible on desktop (when hovering the mouse pointer). On mobile, you may still tap anywhere else on the tooltip and have it propagate to the chart (to choose a different chart data point). Not having this button and only reacting to a tap on the tooltip would be bad UX-wise because it would prevent you from selecting other chart data points that are under it. But I know that (i) icon is not the nicest thing. It expects that people would find out that it is tappable which I am not 100% sure. On the other hand, there is (i) on other places in HA, I use (i) in Developer Tools/States regularly. There are not that many alternative options. One option would be to have a link there with "More Info" text or something like that, I tried this initially but it looked too "noisy". I haven't tried to make its font smaller, though, but still, having a clickable link on tooltip seems worse to me. As for me, I'm fine with the existing situation (without this PR), however other people complained in the connected problems, so I created this PR to make them happier. I'm not sure whether they are the majority. On the other hand, it really seem unusual that tapping on a chart opens a dialog.. I believe this PR will make everyone pleased, but I cannot guarantee it. Removing access to More info on mobile entirely will make me force to use the current HA version forever (or update my personal fork every couple of years). But I can live with that, too. So whatever, you are the boss. :) |
I think putting an actionable item in the tooltip will always be a problem, as it might not be expected and could prevent the user from interacting with the chart, especially on small charts with big tooltips. I will discuss this with our UX team. |
This is fantastic! I really dislike needing to hold and wait before releasing my finger when trying to read a value off the history graphs on mobile. If I release too early it jumps into the more info page of the entity I was already looking at. Leads to a loop of history -> info -> history -> info when I'm just trying to see the value of the graph at a specific point in time. |
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
Still would very much like to see this functionality. |
Thanks @k3a for this PR! I've looked into this from a UX point of view. The problem, as I see it, is that it's not clear what will happen when you tap the graph on mobile. Our users would assume what would happen based on experience and different mental models. We have two options:
In the case of our history graph card, you can have multiple entities on one card. Right now, the more-info dialog of an entity opens when you tap the right little line. This is consistent with the design pattern that opens up more-info about an entity when you tap anywhere other than the action. But I think we should be coherent here. I agree with your PR to always show the tooltip on tap. The primary function of the card is to display and compare data. Next step could be to get more details about the entity. Currently we break this flow. I like that you made a difference between tap and click devices. Design wise I would suggest to have a clear label instead of the (i) icon. For example the text button with the label |
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Breaking change
Proposed change
Some people complained that tapping on a chart to open More Info dialog instantly is not a common or expected behavior on mobile UIs.
Therefore this PR adjusts the functionality by introducing a tooltop-footer slot in the
ha-chart-base
component. This slot is then used by thestate-history-chart-line
and thestate-history-chart-timeline
to conditionally display a clickable (i) info button in the tooltip footer.The decision to display this tooltip button is based on a type of native touch/mouse event which triggered
onTap
oronHover
on the chart. For mouse events, the tooltip button is not visible and a click on a chart opens More Info directly (the current state). For non-mouse events, this (i) info button is displayed and can be additionally tapped on to display More Info.The decision to use a clickable (i) tooltip button instead of just reacting to a tap on the tooltip itself was made because sometimes a tap on a tooltip is a valid action if there is a graph data point under the tooltip which a user wants to select. Therefore it is best to keep this functionality and just add this small clickable (i) instead.
Additionally, this PR also decreases the z-index CSS rule of the tooptip div from 1000 to 1 to prevent over-drawing of the sidebar or dialogs with chart tooltips.
I also set
user-select
CSS rule tonone
on the tooltip div to avoid selecting text on a tooltip in History panel.Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: